pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let num_str = num_str.trim_end_matches(")");
    let (num_str, base) = num_str.split_once("(").unwrap();
    let base: u8 = base.parse().unwrap();

    let mut r = vec![];
    /// Multiply a big number, whose base is `b`, by `x` and add a digit `y`
    fn mul_add(r: &mut Vec<u8>, b: u8, x: u8, mut y: u8) {
        for i in 0..r.len() {
            let p = r[i] * x + y;
            y = p / b;
            r[i] = p % b;
        }
        while y > 0 {
            r.push(y % b);
            y /= b;
        }
    }
    for c in num_str.bytes() {
        mul_add(
            &mut r,
            to_base.try_into().unwrap(),
            base,
            match c {
                b'a'..=b'z' => c - b'a' + 36,
                b'0'..=b'9' => c - b'0',
                _ => unreachable!(),
            },
        );
        // println!("{:?}", r);
    }
    // println!();
    r.iter()
        .map(|c| match c {
            0..=9 => (c + b'0') as char,
            10..=35 => (c - 10 + b'a') as char,
            _ => unreachable!(),
        })
        .rev()
        .collect()
}
